<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
</h:head>
<h:body>
	<ui:include src="../horizontal_menu.xhtml">
	</ui:include>
	<h:form enctype="multipart/form-data">
				<p:panel header="Join Request">
					<h:panelGrid columns="3" id="regGrid">
					
						<h:outputLabel for="citizen">Citizen: </h:outputLabel>
						<p:outputLabel id="citizen" value="#{userBean.fullName}" />
						<h:message for="citizen"/>
						
						<h:graphicImage value="#{('/partysymbols/'.concat(joinRequestBean.party.symbol))}" width="200" height="171" />
						<p:outputLabel value="#{'The citizen is aking to join to: '.concat(joinRequestBean.party.name)}"></p:outputLabel>
						<h:message for="citizen"/>
						
						<h:outputLabel for="letter">Presentation letter: </h:outputLabel>
						<p:inputTextarea rows="10" cols="60" id="letter"  value="#{joinRequestBean.joinrequest.letter}"  binding="#{partyCreationBean.imgUploader}" counter="display" maxlength="510" counterTemplate="{0} characters remaining." autoResize="false" />
						<h:message for="letter" />
						
						<h:outputText />
						<h:outputText id="display" />
						<h:outputText />
						
						<h:outputLabel for="upcv">Upload CV[to complete]: </h:outputLabel>
   						<p:fileUpload id="upcv" value="#{joinRequestBean.file}" mode="simple"  allowTypes="/(\.|\/)(pdf)$/" binding="#{joinRequestBean.uploader}" />
						<h:message for="upcv"/>
					</h:panelGrid>
					<p:commandButton value="Submit" ajax="false"  
                action="#{joinRequestBean.submitRequest()}"/>  
				</p:panel>
		</h:form>
	
</h:body>
</html>